package com.jic.member.constant.enums;

public enum EventCodeEnums {
	MEMBER_UPGRADE("member_upgrade",EventTypeEnums.MEMBER_EVENT_TYPE.getType(),"升级事件"),
	MEMBER_DOWNGRADE("member_downgrade",EventTypeEnums.MEMBER_EVENT_TYPE.getType(),"降级事件"),


	COUPONS_VERIFICATION("coupons_verification",EventTypeEnums.CONSUME_EVENT_TYPE.getType(),"优惠券核销"),
	REDENVELOPE_VERIFICATION("redEnvelope_verification",EventTypeEnums.CONSUME_EVENT_TYPE.getType(),"红包核销"),
	POINTS_EXCHANGE("points_exchange",EventTypeEnums.CONSUME_EVENT_TYPE.getType(),"积分兑换"),
	POINTS_CASH_IN("points_cash_in",EventTypeEnums.CONSUME_EVENT_TYPE.getType(),"积分抵现"),
	;
	EventCodeEnums(String code, Integer eventType, String name) {
		this.code = code;
		this.eventType = eventType;
		this.name = name;
	}
	private String code;
	private Integer eventType;
	private String name;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getEventType() {
		return eventType;
	}

	public void setEventType(Integer eventType) {
		this.eventType = eventType;
	}

	private static EventCodeEnums lookupByCode(String code){
		EventCodeEnums eventCodeEnums = null;
		for (EventCodeEnums value : EventCodeEnums.values()) {
			if(value.getCode().equals(code)){
				eventCodeEnums = value;
				break;
			}
		}
		return eventCodeEnums;
	}
}
